//
//  SearchNetwayButton.m
//  YSSmartHome
//
//  Created by Yahaong on 16/8/24.
//  Copyright © 2016年 yahaong. All rights reserved.
//

#import "SearchGatewayButton.h"
#import "YHMarcros.h"
#import "UIView+Frame.h"

@implementation SearchGatewayButton

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.titleLabel.textAlignment = NSTextAlignmentCenter;
        self.titleLabel.font = [UIFont systemFontOfSize:14];
        [self setTitleColor:RGBColor(102, 102, 102) forState:UIControlStateNormal];
    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    // 调整图片
    self.imageView.yh_y = self.yh_height * 0.15;
    self.imageView.yh_width = kIphoneSize_Widith(41);
    self.imageView.yh_height = self.imageView.yh_width;
    self.imageView.yh_centerX = self.yh_width * 0.5;
    
    // 调整文字
    self.titleLabel.yh_x = 0;
    self.titleLabel.yh_y = CGRectGetMaxY(self.imageView.frame);
    self.titleLabel.yh_width = self.yh_width;
    self.titleLabel.yh_height = self.yh_height - self.titleLabel.yh_y;
}

- (void)setHighlighted:(BOOL)highlighted
{
    
}
@end
